﻿Alter table [dbo].[AppUsers] ADD [SecurityStamp] nvarchar(50) NOT NULL DEFAULT ''
CREATE TABLE [dbo].[AspNetUserClaims] (
    [Id] [int] NOT NULL IDENTITY,
    [UserId] [int] NOT NULL,
    [ClaimType] [nvarchar](max),
    [ClaimValue] [nvarchar](max),
    CONSTRAINT [PK_dbo.AspNetUserClaims] PRIMARY KEY ([Id])
)
CREATE INDEX [IX_UserId] ON [dbo].[AspNetUserClaims]([UserId])
CREATE TABLE [dbo].[AspNetUserLogins] (
    [LoginProvider] [nvarchar](128) NOT NULL,
    [ProviderKey] [nvarchar](128) NOT NULL,
    [UserId] [int] NOT NULL,
    CONSTRAINT [PK_dbo.AspNetUserLogins] PRIMARY KEY ([LoginProvider], [ProviderKey], [UserId])
)
CREATE INDEX [IX_UserId] ON [dbo].[AspNetUserLogins]([UserId])
CREATE TABLE [dbo].[AspNetUserRoles] (
    [UserId] [int] NOT NULL,
    [RoleId] [int] NOT NULL,
    CONSTRAINT [PK_dbo.AspNetUserRoles] PRIMARY KEY ([UserId], [RoleId])
)
CREATE INDEX [IX_UserId] ON [dbo].[AspNetUserRoles]([UserId])
CREATE INDEX [IX_RoleId] ON [dbo].[AspNetUserRoles]([RoleId])
CREATE TABLE [dbo].[AspNetRoles] (
    [Id] [int] NOT NULL IDENTITY,
    [Name] [nvarchar](256) NOT NULL,
    CONSTRAINT [PK_dbo.AspNetRoles] PRIMARY KEY ([Id])
)
CREATE UNIQUE INDEX [RoleNameIndex] ON [dbo].[AspNetRoles]([Name])
ALTER TABLE [dbo].[AspNetUserClaims] ADD CONSTRAINT [FK_dbo.AspNetUserClaims_dbo.AppUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AppUsers] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[AspNetUserLogins] ADD CONSTRAINT [FK_dbo.AspNetUserLogins_dbo.AppUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AppUsers] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[AspNetUserRoles] ADD CONSTRAINT [FK_dbo.AspNetUserRoles_dbo.AppUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AppUsers] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[AspNetUserRoles] ADD CONSTRAINT [FK_dbo.AspNetUserRoles_dbo.AspNetRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[AspNetRoles] ([Id]) ON DELETE CASCADE
CREATE TABLE [dbo].[__MigrationHistory] (
    [MigrationId] [nvarchar](150) NOT NULL,
    [ContextKey] [nvarchar](300) NOT NULL,
    [Model] [varbinary](max) NOT NULL,
    [ProductVersion] [nvarchar](32) NOT NULL,
    CONSTRAINT [PK_dbo.__MigrationHistory] PRIMARY KEY ([MigrationId], [ContextKey])
)
INSERT [dbo].[__MigrationHistory]([MigrationId], [ContextKey], [Model], [ProductVersion])
VALUES (N'201403242318260_initial', N'CustomMembershipSample.IdentityModels.AppDbContext',  0x1F8B0800000000000400ED5CDD6EE4B615BE0FD0771074D5048E657B912235661238E37562746D2F76BC41EF16B4448F85489422518E8DA24FD68B3E525FA1A4444AE29FFE46D26817816F6CFE1C9EC3F3913C87FAE8FFFDE7BFAB1F5FC2C07A8649EA47686D9F1E9FD816446EE4F968B7B633FCF8EDF7F68F3FFCE5ABD55B2F7CB17EE5EDDED076A4274AD7F613C6F1B9E3A4EE130C417A1CFA6E12A5D1233E76A3D0015EE49C9D9CFCDD393D75201161135996B5FA9021EC8730FF83FCB989900B639C81E026F26090B27252B3CDA55AB72084690C5CB8B637598AA3F006860F4499273FDE82300EE0F1B5078948FC5A08B0AD8BC00744B92D0C1E6D0B2014618089EAE71F53B8C5498476DB981480E0FE3586A4DD230852C84C3AAF9A77B5EEE48C5AE7541DB92837D7B6A7C0D3376CBA1CB9FBA049B7CBE92413FA369F256A753EA96BFBC2F31298921993C73ADF04096DD771CA8F99A0234BDFFCA8440F0119FDA10D039C25708D608613101C59EFB387C077FF015FEFA3DF205AA32C08EACA13F5499D50408ADE27510C13FCFA013E3293AE3DDB72C47E8EDCB1EC56EB53587B8DF09B33DBBA258383870096D8A8CDCC164709FC192298000CBDF7006398202AA39810657469AC4DDEA6188D80912C35DBBA012FEF20DAE1A7B54D7EB5AD2BFF057ABC8469F011F96465924E38C960DB205BA22B9C7C944D44567232BD3564D926ED2E9264DC82677F977B4C927611C754A06D7D80415E4F615A6C16C7ACEE138333242BE32A89C20F515075AC2A3FDD83640731512C32B5D84659E24ACAAD9C6A1D36AF4EAEE9DEABB310F4E7EA6C5D9D6F43E0070D803EFBEE6F2300FA92E8B64920D5908F458BEEC9A9D80E6C49D63B90E20B17FBCFC4BACBDAAAAF0436F77F0FD2F48F28F17E01E9D32C2B99FE36C20CF79CA62D74B3844C11D919C3787C3BCDBB4DB593ECBFDFF0DDC4BCDFF01DA9AB7A9B00F861B36EBC89AA585163D48A55F755E95DB4F351B34ABC89AA525163548955F755890A69D688B55015CA2B8CFA14B53A75FA1C12F9448F724AE492FE3C265A8F894111896EE95101D3C76974A45F41908D3D541F90E64B6F1490E6921600D25C0F52FCEC7B344873DA7BF0C6447CA7F61C667D9782A499D1E7A767DF4F71D60A66CE3D78FFA5D9371EA79BF668313915B6002CEB91A66D4A351E02CA31F64C3EF634CE1DCDB10B71EAD24FD199320163584711690CEBA80F3FB11642585755E8C2BA5A6D9FB0EE224D23D7CFD510379B5A6A205AF51679566B9E504C6D2D5025134CC0E6C7045E440BB209DB328CEED0250C2086164D2AE99DE506A42EF0D469259678DD552AAF4A6A2AF1CB4751A56F949108A261422105820D711359233EC22AFC7DE4FA3108DA6645EAD871E55083CB21E49A4B18434441DF667E97B18D5BB1530E2339A26D7E564E0D5EDD50C792BE36FFCA19E0A1F126A59CA23E2C4D9A146DE284CC0835D1F2CF06672C936FF3AB9CD61F1A67D23D82A80FCB7426C599382133E24CB4FCB3C159713FD3E656E9B2E6D028136F8754758A7875529C09333223CC04D33F0794D5C2C506B7EA6247C1AD3A974E87324DB03A37CAD419990765AAE95DC6D5E7BE93A0ACC813481F4C7AC0A442DAE5032D842F5893AA128358B69AB2EC48F63E15BA8558FD3A51E5257278EE34CB603992DA9FEF992DFD79646690C1A2B67621FCA3804E083B92DB8570C0371854AC8716510D32B4FD6B2050F4A97F1DAAB5337E4292B1D925532CF52FFDA940BC4B76571353535ADE9444637B4C04C789791674794B97CC6590FD52B65137BEC2F468C6737C9B8DD705D35DC2E941C64B21B0683CD77534E3D97A32DBAE09F03A8478832C17C332D1F0DAFE3186EDF54B28ADEDA6B0A343E051535CAB718760617FDBF97D5879CE95752BA7A0FFB1829563E009AE6E401CFB6857E30DB2126BCB4883DF6EFB53E7C24286E30A132B9FCAE548384AC00E4AB59421E5C12B3F49F125C0E001D0CBC98D172ACD8453DD70B0F0A1E4835BF5193F72780FFA3BFB10D887CBA7098898C42B626B48A3A9FCFE57DDF3D59E1625738200249ADBE64D14642132C775E6DE0595AEDE7FA3B9756E92C078727511ACA887169C052728C20BBBCBE1194C5D8C29ABA1EB41728612912A4050520311599D7067DA6AF6C61C0B160760CED4731ACC3182585D002BEA2E43A07FD5250915DDE5A914B0BA50B5B6BB64911C5697CA6BFA22BCF8E623631C0195A8D62449627309EB57AC5ACCCAA942C249564F91260D5A3E86AED3AC9F7EBB9C71CFADB833C2AE5B15F794C5D8318A3056BE241419A3FC115054E4C9835064E86ADCB3448A8AB06135F36ACC3205DE89B05935F16ECCF23E8B135908BC273B98F34B8BC187B3BEF7B45B04BFAAAB4B315DDF1DCC79137A6DB8C7FA796BBFE3400D076E0DA1C0A41E52D250B949397A998E4A69E78AA5801DDEB0C93961D1C4B6F82E456298D714C3F0983638DEFE1E6C029FD85B35B801C87F84292ED841F6D9C9E999F4E66D39EFCF9C34F5024D0AAD798426BA6B0686934F27B595C3D497D65B7BDF859E41E23E81E4AF2178F9BA2EA9F71BAEBD2449EFB4F69225B2F8F21954BE425C230FBEACED7FE55DCEADEB7F7E2A7A1D59770981EFB97562FD7B644EE617021EE1F911F7934A8AEBE732CD6B238FFC81C77C6DA413D845B72A8D1C099BA8C629AC26B00DA23C33CD8B8FACEBF423F27FCF48C53D199682D5EC81E1AF8F7AD8DAFF35C897B11E66DA6D345BA6FC3863BF0D5879803191EF3549D817F99641BB35E60F0AF67FAA309AEC851E956A78BFD02702332E77F15D41D7818B5E13B96AA89B16B88BDF0E3A93E9048C77264F48BC3F2453907374E6A6D5CFC2D2327E875C1EFDAF0769FEB0C45246A79A9D193F13ADCFF41964A188E9467F3F2C6218776E768EFB4C88317DF25828623A11D90FCF5D2F488E87A0ACCFC852375CB12F0F39DDC9E987E5A31F0E399D5D3933720E4E3857196CB2FFB48CF2263E79F1BD636D7B0F11717411B19BD9C206927613E15C3B4051D9493E0B871AD8E8DA11D2F816623A8881FA6BE2AC3752D69B4732F06C1B88ED6DBCF6E6F1F4F44ECD70E6A1DA86D10F312B3F5E476C6D66C78AA017B8904B64BFF737505A14227568891CF721260AAB51E4B52C8FC93EC440791350381ACB23ADCBAAEAD49CD0CC1EFC749500400EE3DABFBA25B140EAEF2A11F41FDF22E80AC770D9E61A3D463C1A9034E24DA44BB61B888147CEE88B04FB8FC0C5A4DA25FB4FFE4F35F24F0FF4EBE203F4AED15D86E30C139361F8100897F734AA681A3F27E18B3AAFEEE2FC7F678C610251D3A71F12EFD04F991F78A5DE579AEB3C83081AAEB09B4BEA4B4C6F3077AFA5A4DB087514C4A6AF8CB2EE61180744587A87B6E0190ED18DC0EF1DDC01F7B5FA9A6112D2EE0871DA57973ED825204C998CAA3FF99360D80B5F7EF83F501ADE96F1590000 , N'6.1.0-30225')

